<template>
	<!-- 标题文字组件 -->
	<view :style="{paddingTop: `${newData.marginTop}rpx`,paddingBottom: `${newData.marginBottom}rpx`,
	   paddingLeft: `${newData.marginLR}rpx`,paddingRight: `${newData.marginLR}rpx`}">
		<view @click="jumpPage(newData.pageUrl)" style="width: 100%;" :pageUrl="newData.pageUrl" :style="{
						height: `${newData.height}rpx`,
						lineHeight: `${newData.height}rpx`,
						color: `${newData.color}`,
						backgroundColor: `${newData.backgroundColor}`,
						fontSize: `${newData.fontSize}rpx`,
						textAlign:`${newData.position}`,
						marginBottom:`${newData.marginbotttom}rpx`,
						marginTop:`${newData.margintop}rpx`,
						paddingLeft:`${newData.paddingleft}rpx`,
						paddingRight:`${newData.paddingright}rpx`
					}">
			{{newData.title}}
		</view>
	</view>
</template>

<script>
	const app = getApp();
	// import divBaseNavigator from '../div-base/div-base-navigator.vue'
	export default {
		props: {
			value: {
				type: Object,
				default: function() {
					return {}
				}
			}
		},
		components: {
			// divBaseNavigator
		},
		data() {
			return {
				theme: app.globalData.theme, //全局颜色变量
				newData: this.value,
			};
		},
		methods: {
			jumpPage(page) {
				if (page) {
					uni.navigateTo({
						url: page,
						fail: () => {
							uni.switchTab({
								url: page
							});
						}
					});
				}
			}
		}
	}
</script>

<style scoped lang="scss">

</style>